* {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #000;
    /* 视距，让元素看起来更有3D效果 */
    perspective: 900px;
}
section {
    position: relative;
    width: 200px;
    height: 300px;
    /* 让其子元素位于3D空间中 */
    transform-style: preserve-3d;
    animation: rotate 20s linear infinite;
    @for $i from 1 to 9 {
        div:nth-child(#{$i}) {
            transform: rotateY(($i - 1) * 45deg) translateZ(300px);
        }
    }
    &:hover {
        animation-play-state: paused;
    }
    div {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        text-align: center;
        -webkit-box-reflect: below 15px -webkit-linear-gradient(transparent 50%, rgba(255, 255, 255, 0.3));
        img {
            width: 100%;
            height: 100%;
        }
    }
}

@keyframes rotate {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}
